<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>翻转世界</title>
</head>

<body>
  <!-- 1.创建一个容器 -->
  <div id="app">
    <p>{{text}}</p>
    <button @click="fn">逆转世界</button>
  </div>
  <!-- 2.导包 -->
  <script src="./js/vue-2.7.14.js"></script>
  <!-- 3.实例化Vue对象 -->
  <script>
    let app = new Vue({
      el: '#app',
      data: {
        text: 'Hello, World'
      },
      methods: {
        fn() {
          this.text = this.text.split('').reverse().join('')
        }
      }
    })
  </script>
</body>

</html>